
   <!-- 当前位置 -->
<div id="urHere">DouPHP 管理中心<b>></b><strong>资讯</strong> </div>   <div class="mainBox" style="height:auto!important;height:550px;min-height:550px;">
        <h3><a href="{:U('addNews')}" class="actionBtn add">添加资讯</a>资讯</h3>
       <div class="filter">
           <form action="{:U('index')}" method="get">
               <input name="keyword" type="text" class="inpMain" value="{:I('get.keyword')}" placeholder="资讯标题、资讯内容、作者" size="30" />
               <select name="search">
                   <option value="" <if condition="I('get.search') neq 1 and I('get.search') neq 2 and I('get.search') neq 3 and I('get.search') neq 4"> selected="selected" </if>>--资讯类型--</option>
                   <option value="1" <if condition="I('get.search') eq 1"> selected="selected" </if>>代练服务</option>
                   <option value="2" <if condition="I('get.search') eq 2"> selected="selected"</if>>寄售交易</option>
                   <option value="3" <if condition="I('get.search') eq 3"> selected="selected"</if>>账号交易</option>
                   <option value="4" <if condition="I('get.search') eq 4"> selected="selected"</if>>其他服务</option>
               </select>
               <input name="submit" class="btnGray" type="submit" value="筛选" />
               <!--<button type="submit" class="btnGray" type="submit">搜 索</button>-->
           </form>
       </div>
    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
     <tr>
         <th align="center">资讯编号</th>
         <th align="center">资讯标题</th>
         <th align="center">资讯内容</th>
         <th align="center">资讯类型</th>
         <th align="center">发布作者</th>
         <th align="center">浏览总数</th>
         <th align="center">点赞次数</th>
         <th align="center">发布时间</th>
         <th align="center">操作</th>
      </tr>
        <foreach name="data" item="val" >
            <tr>
                <td align="center">{$val['news_id']}</td>
                <td align="center">{$val['news_tittle']}</td>
                <td align="center">{$val['news_content']}</td>
                <td align="center">
                    <if condition="$val['news_type'] eq 1"> 代练服务
                        <elseif condition="$val['news_type'] eq 2"/> 寄售交易
                        <elseif condition="$val['news_type'] eq 3"/> 账号交易
                        <elseif condition="$val['news_type'] eq 4"/> 其他服务
                        <else /> ***
                    </if>
                </td>
                <td align="center">{$val['news_author']}</td>
                <td align="center">{$val['look_count']}</td>
                <td align="center">{$val['great_count']}</td>
                <td align="center">{$val['creat_time']}</td>
                <td align="center">
                    <a href="{:U('/News/modNews', array('news_id'=>$val['news_id']))}">编辑</a>
                    | <a href="javascript:void(0);" data-id="{$val['news_id']}" class="delNews">删除</a>
                </td>
            </tr>
        </foreach>


          </table>
       <div class="clear"></div>
       <div class="pager">
           {$show}
       </div>
   </div>
   <script type="text/javascript">
       $(function(){
           $('a.delNews').click(function(){
               if (confirm('确定要删除？')) {
                   var id = $(this).attr('data-id');
                   window.location.href = "/News/delNews/news_id/"+id;
               }
           })
       });
   </script>
